#include "point.h"
#include <cmath>
#include <QDebug>

Point::Point(qreal x, qreal y, qreal vx, qreal vy)
    : m_x(x), m_y(y), m_vx(vx), m_vy(vy) {}

void Point::move() {
    m_x += m_vx;      // 更新x坐标
    m_y += m_vy;      // 更新y坐标

    qDebug() << "Position:" << m_x << m_y;
}

QPointF Point::position() const {
    return QPointF(m_x, m_y);
}

void Point::setX(qreal x) { m_x = x; }
void Point::setY(qreal y) { m_y = y; }
void Point::setVx(qreal vx) { m_vx = vx; }
void Point::setVy(qreal vy) { m_vy = vy; }

qreal Point::vx() const { return m_vx; }
qreal Point::vy() const { return m_vy; }
